% compression of time series
% read a compressed rts file

fid = fopen('e:\manoj\data\test','rb');
blk = 151;
ll = 128;
[FirstData,count]= fread(fid,5,'int16');
st = 1;
en = ll;

for i = 1:blk,
   for j = 1:5,
      [A,count]= fread(fid,1,'int8');
      if A == 1,
         [diff,count]= fread(fid,ll,'int8');
      else,
         [diff,count]= fread(fid,ll,'int16');
      end;
      diffData(:,j) = diff;
   end;
   BlkData(st:en,:) = diffData;
   st = st+ll;
   en = en+ll;
end;

fclose(fid);



      
      
         